// 后台通信模块
import axios from 'axios'
import store from '../store/index'

const axins = axios.create(({
    timeout: 6000,
    headers: { 'Content-Type': 'application/json;charset=UTF_8' },
    baseURL: store.state.startmenu.conn.url
}))


// axins.interceptors.request.use(config => {

// })

// axins.interceptors.response.use(
//     response => response,
//     err => {
//         if (err.response) {
//             switch (err.response.status) {
//                 // case 404:
//             }
//         }
//     }
// )


const API_PARKING_STATUS = '/api/parkingstatus'


export default {
    load_parking_status(param = {}) {
        return axins.get(API_PARKING_STATUS, param)
    },

    ping(url) {
        return axins.get(url)
    },

    get(url, param) {
        return axins.get(url, param)
    }
}